package com.second.common.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 *  * @program: second
 *  * @description:
 *  * @author: 胡萌
 *  * @create: 2023-05-26 16:07
 * 订单
 * @TableName t_order
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_order")
@ApiModel(value="Order对象", description="订单表")
public class Order<LocalDateTime> implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 
     */
    @ApiModelProperty(value = "id编号")
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 订单号
     */
    @ApiModelProperty(value = "订单号")
    private String orderNo;

    /**
     * 课程id
     */
    @ApiModelProperty(value = "课程id")
    private String courseId;

    /**
     * 课程名称
     */
    @ApiModelProperty(value = "课程名称")
    private String courseTitle;

    /**
     * 课程封面
     */
    @ApiModelProperty(value = "课程封面")
    private String courseCover;

    /**
     * 讲师名称
     */
    @ApiModelProperty(value = "讲师名称")
    private String teacherName;

    /**
     * 会员id
     */
    @ApiModelProperty(value = "会员id")
    private String memberId;

    /**
     * 会员昵称
     */
    @ApiModelProperty(value = "会员昵称")
    private String nickname;

    /**
     * 会员手机
     */
    @ApiModelProperty(value = "会员手机")
    private String mobile;

    /**
     * 订单金额（分）
     */
    @ApiModelProperty(value = "订单金额（分")
    private BigDecimal totalFee;

    /**
     * 支付类型（0：微信 1：支付宝）
     */
    @ApiModelProperty(value = "支付类型（0：微信 1：支付宝）")
    private Integer payType;

    /**
     * 订单状态（0：未支付 1：已支付）
     */
    @ApiModelProperty(value = "订单状态（0：未支付 1：已支付）")
    private Integer status;

    /**
     * 逻辑删除 1（true）已删除， 0（false）未删除
     */
    @ApiModelProperty(value = "逻辑删除 1（true）已删除， 0（false）未删除")
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;

    public Order(){

    }

    @ApiModelProperty(value = "订单日志表")
    @TableField(exist = false)
    private PayLog payLog;
}